home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 23
/
Amiga Format AFCD23 (Feb 1998, Issue 107).iso
/
-seriously_amiga-
/
shareware
/
programming
/
e
/
easyplugins
/
examples
/
text_demo.e
< prev
next >
Wrap
Text File
|
1997-12-06
|
2KB
|
88 lines
/*
text_demo: example program for text_plugin
*/
OPT PREPROCESS, OSVERSION=37
MODULE 'tools/easygui', 'easyplugins/text', 'graphics/text',
'utility', 'utility/tagitem'
DEF text_a:PTR TO text_plugin, text_b:PTR TO text_plugin,
text_c:PTR TO text_plugin, text_d:PTR TO text_plugin,
disabled=FALSE, bars=FALSE
PROC main() HANDLE
DEF ta:PTR TO textattr, font:PTR TO LONG
IF (utilitybase:=OpenLibrary('utility.library', 37))=NIL THEN Raise("utlb")
ta:=['topaz.font', 8, FS_NORMAL, FPB_ROMFONT]:textattr
font:=OpenFont(ta)
NEW text_a.text([PLA_Text_Text, 'Example 1 - Window''s font...',
TAG_DONE])
NEW text_b.text([PLA_Text_Text, 'Example 2 - Left justified',
PLA_Text_Justification, PLV_Text_JustifyLeft,
TAG_DONE])
NEW text_c.text([PLA_Text_Text, 'Example 3 - Right justified',
PLA_Text_Justification, PLV_Text_JustifyRight,
TAG_DONE])
NEW text_d.text([PLA_Text_Text, 'Example 4 - topaz.font/8',
PLA_Text_Justification, PLV_Text_JustifyCenter,
PLA_Text_Font, ta,
TAG_DONE])
easyguiA('text_plugin examples',
[ROWS,
[PLUGIN, 1, text_a],
[PLUGIN, 1, text_b],
[PLUGIN, 1, text_c],
[PLUGIN, 1, text_d],
[COLS,
[CHECK, {toggle_disabled}, '_Disabled?', disabled, FALSE, -1, "d"],
[CHECK, {toggle_bars}, '_Bars?', bars, FALSE, -1, "b"],
[SPACEH],
[BUTTON, 0, 'Quit']
]
])
EXCEPT DO
END text_a, text_b, text_c, text_d
IF font THEN CloseFont(font)
IF utilitybase THEN CloseLibrary(utilitybase)
ENDPROC
PROC toggle_disabled()
IF disabled THEN disabled:=FALSE ELSE disabled:=TRUE
text_a.set(PLA_Text_Disabled, disabled)
text_b.set(PLA_Text_Disabled, disabled)
text_c.set(PLA_Text_Disabled, disabled)
text_d.set(PLA_Text_Disabled, disabled)
ENDPROC
PROC toggle_bars()
IF bars THEN bars:=FALSE ELSE bars:=TRUE
text_a.set(PLA_Text_DrawBar, bars)
text_b.set(PLA_Text_DrawBar, bars)
text_c.set(PLA_Text_DrawBar, bars)
text_d.set(PLA_Text_DrawBar, bars)
ENDPROC